package com.szrt.day20170419.interfaces.ch02;


/**
 * 苦逼的类： 如何去优化?
 * @author scott-13926583118
 * 2017年4月19日
 *
 */
public class Cal {

	public int add(int x, int y) {
		return x+y;
	}
	
	
	public int add(Carriage carriage) {
		int x  = carriage.getX();
		int y  = carriage.getY();
		return x+y;
	}
	
	public int add(Car car) {
		int x  = car.getX();
		int y  = car.getY();
		return x+y;
	}
	
	public int add(Saozhou saozhou) {
		int x  = saozhou.getX();
		int y  = saozhou.getY();
		return x+y;
	}
	
	
	
	

}
